package com.sq.ai.controller;

import com.sq.ai.base.BaseController;
import com.sq.ai.pojo.AlgorNode;
import com.sq.ai.pojo.SysAlgor;
import com.sq.ai.service.AlgorNodeService;
import com.sq.ai.vo.SysAlgorVo;
import com.sq.common.web.base.TableDataInfo;
import com.sq.common.web.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author Li sir
 * @Date 2025/3/3
 */
@RestController
@RequestMapping("/api/algor2/")
public class AlgorNodeController extends BaseController {

    @Autowired
    private AlgorNodeService algorNodeService;


    @PostMapping("select")
    public TableDataInfo selectByWhere(@RequestBody AlgorNode sysAlgor){
        startPage(sysAlgor.getPageNum(),sysAlgor.getPageSize());
        List<AlgorNode> list = algorNodeService.selectByWhere(sysAlgor);
        return getDataTable(list);
    }

    @GetMapping("algorLable")
    public AjaxResult getAlgorLabel(){
        List<SysAlgorVo> algorVoList = algorNodeService.getAlgorLabel();
        return AjaxResult.success(algorVoList);
    }

}
